<?php
// +----------------------------------------------------------------------
// |
// +----------------------------------------------------------------------
namespace app\app\controller\v1;
use app\app\Appbase;


class Recruit extends Appbase
{
	

	
	/**
	*增加招商加盟
	* /app/v1/recruit/add_merchants
	* 需要登录
	* @is_need_login false
	*/
	public function add_merchants($data){
		try {

            $param=json_decode($data,true);
          
			$res = model("admin/Recruit")->save([
					'name'=>$param['name'],
					'sex'=>$param['sex'],
                    'phone'=>$param['phone'],
                    'industry'=>$param['industry'],
                    'industry_time'=>$param['industry_time'],
                    'join_area'=>$param['join_area'],
                    'join_population'=>$param['join_population'],
                    'capital_money'=>$param['capital_money'],
                    'is_team'=>$param['is_team'],
                    'type'=>1,
                    'description'=>$param['description']

				]);
            if($res){
                return $this->ReSucess(true);
            }
            return $this->ReSucess(false);
		} catch (\Exception $e) {
			return $this->ReError($e->getMessage());
		}
	}


    /**
     *招生学习
     * /app/v1/recruit/add_study
     * 需要登录
     * @is_need_login false
     */
    public function add_study($data){
        try {
            $param=json_decode($data,true);
            $res = model("admin/Recruit")->save([
                'name'=>$param['name'],
                'sex'=>$param['sex'],
                'phone'=>$param['phone'],
                'industry'=>$param['industry'],
                'age'=>$param['age'],
                'hobby_course'=>$param['hobby_course'],
                'learn_purpose'=>$param['learn_purpose'],
                'more_planning'=>$param['more_planning'],
                'type'=>2


            ]);
            if($res){
                return $this->ReSucess(true);
            }
            return $this->ReSucess(false);
        } catch (\Exception $e) {
            return $this->ReError($e->getMessage());
        }
    }

    /**
     *就业招聘
     * /app/v1/recruit/add_obtain
     * 需要登录
     * @is_need_login false
     */
    public function add_obtain($data){
        try {
            $param=json_decode($data,true);
            $res = model("admin/Recruit")->save([
                'name'=>$param['name'],
                'sex'=>$param['sex'],
                'phone'=>$param['phone'],
                'industry'=>$param['industry'],
                'industry_time'=>$param['industry_time'],
                'obtain_area'=>$param['obtain_area'],
                'salary_range'=>$param['salary_range'],
                'is_training'=>$param['is_training'],
                'is_work_history'=>$param['is_work_history'],
                'certificates'=>$param['certificates'],
                'type'=>3


            ]);
            if($res){
                return $this->ReSucess(true);
            }
            return $this->ReSucess(false);
        } catch (\Exception $e) {
            return $this->ReError($e->getMessage());
        }
    }

}

